Skip to content

Conversation

mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Sep 6, 2025

⚡️ What's your motivation?

With Surefire 3.5.4 the heuristic for naming tests changed[1]. As a result the surefire strategy no longer works as expected. But the long strategy now does provide reasonable results.

On Surefire <= 3.5.2 with the surefire strategy the test results would be rendered as:

<testcase name="a few cukes" classname="Belly" time="0.062">

This includes both the scenario and feature name.

On Surefire >= 3.5.4 with the surefire strategy the test results will be rendered as:

<testcase name="a few cukes" classname="RunCucumberTest" time="0.06">

This does not include the feature name.

On Surefire >= 3.5.4 with the long strategy the test results will be rendered as:

<testcase name="Belly - a few cukes" classname="RunCucumberTest" time="0.06">

This does the scenario and feature name and also the name of the Suite that ran Cucumber. This is the optimal outcome.

  1. [SUREFIRE-2298] fix xml output with junit 5 nested classes (fix integration with Cucumber and Archunit) apache/maven-surefire#828

Closes: #2984

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

There is no way to detect which version of Surefire is being used. So recommending an upgrade of Surefire seems to be the only sensible thing to do. The alternative is potentially manged reports. If you have a better alternative, please do create a new issue to request that solution.

📋 Checklist:

  • Wait for Surefire 3.5.4 to be released.
  • Upgrade to Surefire 3.5.4
  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

With Surefire 3.5.4 the heuristic for naming tests changed[1]. As a
result the `surefire` strategy no longer works as expected. But the
`long` strategy now does provide reasonable results.

On Surefire <= 3.5.2 with the `surefire` strategy the test results would
be rendered as:

```
<testcase name="a few cukes" classname="Belly" time="0.062">
```

On Surefire >= 3.5.4 with the `long` strategy the test results will
be rendered as:

```
<testcase name="Belly - a few cukes" classname="RunCucumberTest" time="0.06">
```

1. apache/maven-surefire#828
@mpkorstanje mpkorstanje marked this pull request as ready for review September 14, 2025 00:18
@mpkorstanje mpkorstanje merged commit 2b78f7e into main Sep 14, 2025
6 checks passed
@mpkorstanje mpkorstanje deleted the deprecate-surefire-naming-strategy branch September 14, 2025 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Surefire 3.5.3 does not include Cucumber scenarios in test summary count
1 participant